A problem is known in which when an ejection target makes contact with a nozzle surface, a nozzle formed on the nozzle surface is damaged, and in which thus the ejection performance of a liquid from the nozzle is degraded. It is disclosed that in order for the problem described above to be suppressed, when the floating of the ejection target is detected with a sensor, the nozzle surface is covered with a shutter so as to be protected, whereby the ejection target is prevented from making contact with the nozzle surface.